<%--
  Created by IntelliJ IDEA.
  User: 徐洲
  Date: 2023/12/17
  Time: 18:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%String username = (String) session.getAttribute("username");%>
<nav class="navbar navbar-expand-lg">
  <div class="container"><a href="index.jsp" class="navbar-brand home"><img src="img/logo1.png" alt="摆烂俱乐部" class="d-none d-md-inline-block"><img src="img/logo-small.png" alt="jj logo" class="d-inline-block d-md-none"><span class="sr-only">jj - go to homepage</span></a>
    <div class="navbar-buttons">
      <button type="button" data-toggle="collapse" data-target="#navigation" class="btn btn-outline-secondary navbar-toggler"><span class="sr-only">Toggle navigation</span><i class="fa fa-align-justify"></i></button>
      <!-- 我的收藏 -->
      <%if(session.getAttribute("username")==null){%>
      <button type="button" data-toggle="collapse" data-target="#search" class="btn btn-outline-secondary navbar-toggler"><span class="sr-only">Toggle search</span><i class="fa fa-search"></i></button><a href="register.jsp" class="btn btn-outline-secondary navbar-toggler"><i class="fa fa-shopping-bag"></i></a>
      <%}
      else{ %>
      <button type="button" data-toggle="collapse" data-target="#search" class="btn btn-outline-secondary navbar-toggler"><span class="sr-only">Toggle search</span><i class="fa fa-search"></i></button><a href="./article_collect.jsp" class="btn btn-outline-secondary navbar-toggler"><i class="fa fa-shopping-bag"></i></a>
      <%}%>
    </div>
    <div id="navigation" class="collapse navbar-collapse">
      <ul class="navbar-nav mr-auto">
        <li class="nav-item"><a href="index.jsp" class="nav-link">家</a></li>
        <%--            <li class="nav-item"><a href="article_list.jsp" class="nav-link active">Electronic piano</a></li>--%>
        <%--            <li class="nav-item"><a href="category.jsp" class="nav-link">Piano</a></li>--%>
        <%--            <li class="nav-item"><a href="accordition.jsp" class="nav-link">Accordion</a></li>--%>
        <%--            <%--%>
        <%--              List<Category> categoryList  = categoryDao.getCategoryName();--%>
        <%--              request.setAttribute("categoryList",categoryList);--%>
        <%--            %>--%>
        <%--            <li class="nav-item"><a href="#" class="nav-link" onclick="this.classList.add('active')">全部</a></li>--%>
        <li class="nav-item"><a href="article_list.jsp" class="subheading nav-link" onclick="addActiveClass(this)">全部</a></li>
        <li class="nav-item"><a href="article_my.jsp" class="subheading nav-link" onclick="addActiveClass(this)">我的文章</a></li>
        <li class="nav-item"><a href="article_collect.jsp" class="subheading nav-link" onclick="addActiveClass(this)">我的收藏</a></li>
        <%--            <c:forEach items="${categoryList}" var="item">--%>
        <%--              <li class="nav-item"><a href="#" id="categoryId" class="nav-link" onclick="addActiveClass(this)">${item.category_name}</a></li>--%>
        <%--            </c:forEach>--%>
        <li class="nav-item dropdown menu-large"><a href="aboutUs.jsp" class="nav-link">关于我们<b class="caret"></b></a>
      </ul>
      <div class="navbar-buttons d-flex justify-content-end">
        <!-- /.nav-collapse-->
        <div id="search-not-mobile" class="navbar-collapse collapse"></div><a data-toggle="collapse" href="#search" class="btn navbar-btn btn-primary d-none d-lg-inline-block"><span class="sr-only">Toggle search</span><i class="fa fa-search"></i></a>
        <!-- Cart image -->
        <%if(session.getAttribute("username")==null){%>
        <div id="basket-overview" class="navbar-collapse collapse d-none d-lg-block"><a href="register.jsp" class="btn btn-primary navbar-btn"><i class="fa fa-shopping-cart"></i><span></span></a></div>
        <%}
        else{ %>
        <div id="basket-overview" class="navbar-collapse collapse d-none d-lg-block"><a href="./article_collect.jsp" class="btn btn-primary navbar-btn"><i class="fa fa-shopping-cart"></i><span></span></a></div>
        <%}%>
      </div>
    </div>
  </div>
</nav>
</body>
</html>
